<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/includes/directives/page.jspf"%>
<%@ include file="/WEB-INF/views/includes/directives/taglib.jspf"%>
<div>
	<c:choose>
		<c:when test="${userBean.shoppingCart.itemsInCart != 0}">
			<table border="1">
				<tr>
					<td><fmt:message key="shopping_cart_jsp.table.header.item" /></td>
					<td><fmt:message key="shopping_cart_jsp.table.header.price" /></td>
					<td><fmt:message key="shopping_cart_jsp.table.header.quantity" /></td>
				</tr>
				<c:forEach var="item" items="${userBean.shoppingCart.cart}">
					<tr>
						<td>${item.key.name}</td>
						<td>${item.key.price}</td>
						<td>${item.value}</td>
					</tr>
				</c:forEach>
			</table>
			<br />
			<div id="total">Total: ${userBean.shoppingCart.totalPrice}</div>
			<button class="button" onclick="placeOrder();"><fmt:message key="shopping_cart_jsp.button.place_order" /></button>
			<button class="button" onclick="clearCart();"><fmt:message key="shopping_cart_jsp.button.clear_cart" /></button>
		</c:when>
		<c:otherwise>
			<fmt:message key="shopping_cart_jsp.label.empty_cart" />
	</c:otherwise>
	</c:choose>
</div>
